package linkedList.递归;

import po.ListNode;

/**
 * @author songZiHao
 * @version 1.0.0
 * @ClassName 移除链表元素203.java
 * @Description TODO https://leetcode-cn.com/problems/remove-linked-list-elements/
 * @createTime 2021年03月14日 10:57:00
 */
public class 移除链表元素203 {
    public ListNode removeElements(ListNode head, int val) {
        if (head == null) {
            return head;
        }
        head.next = removeElements(head.next, val);;
        if (head.val == val) {
            head = head.next;
        }
        return head;
    }
}
